Signal processing method for distinguishing and characterizing high-frequency oscillations

ABSTRACT

A device and a signal processing method that can be used with a device to recognize and distinguish a physiological high-frequency oscillation (HFO) from a pathological high-frequency oscillation. The signal processing method detects a physiological HFO in the electrical brain signal one regimen of electrical or optogenetic brain stimulation can be triggered, alternatively if the method detects a pathological HFO associated with epilepsy a different regimen of electrical or optogenetic brain stimulation can be triggered. Thus, the signal processing method can be utilized in a closed loop brain stimulation device that serves the dual purpose of both enhancing memory encoding, consolidation, and recall, or improving cognition, and reducing the probability of a seizure in a patient with epilepsy.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Patent ApplicationSer. No. 62/429,461, filed Dec. 2, 2016, which is hereby incorporated byreference in its entirety.

GOVERNMENT SUPPORT

This invention was made with government support through NIH NS094633awarded by the National Institutes of Health. The Government has certainrights in the invention.

FIELD OF INVENTION

The present invention is generally related to devices and methods forcharacterizing high-frequency oscillations in the brain so as torecognize and distinguish signals associated with epilepticpathophysiological processes, and recognize and distinguish signalsassociated with memory and cognition.

BACKGROUND OF INVENTION

Epilepsies are a family of chronic neurological disorders in whichclusters of nerve cells or neurons in the brain signal abnormally. Theseabnormal brain signals are often characterized by seizures, which aretransient, recurrent perturbations of normal brain function. As achronic condition, epilepsy affects about 1% of the population in theUnited States. Each year, an additional 125,000 Americans are diagnosedwith epilepsy. Indeed, this prevalence will increase substantially inthe near future largely due to the rapidly expanding number of elderlyAmericans, in whom the incidence of epilepsy is the highest.Uncontrolled epilepsy poses a significant burden to society due toassociated healthcare costs and chronic under-unemployment of otherwisephysically and mentally competent individuals, when it occurs inindividuals of a working age.

Anti-epileptic drug (AED) treatment is the standard therapy forepilepsy. Unfortunately, AEDs in current therapeutic use displaysignificant side effect profiles. Additionally, about one third of allpatients remain unresponsive to currently available medications. Theneed for more effective treatments for phamacoresistant epilepsy wasamong the driving forces behind a recent White House-initiated ‘CuringEpilepsy: Focus on the Future’ (‘Cure’) Conference (March, 2000), whichemphasized specific research directions and benchmarks for thedevelopment of effective and safe treatments for people with epilepsy.One of the more common forms of epilepsy in humans that is frequentlyresistant to current therapy is the mesial temporal lobe epilepsysyndrome, or limbic epilepsy, that originates from limbic structuressuch as the hippocampus and amygdala.

At the physiological level, seizure activity can involve the transient,simultaneous hypersynchronous activation of a large population ofneurons, either in one focal area, or throughout the brain, depending onthe type of epilepsy. Seizure symptoms can vary widely. Some people withseizures may stare blankly for a few seconds during a seizure, whileothers may twitch their arms, legs, or other body parts. Having a singleseizure does not indicate epilepsy alone, as at least two or moreunprovoked seizures are generally required for epilepsy diagnosis.

An alternative approach to controlling epilepsy with drugs is throughthe use of neuroprosthetic devices. For nearly thirty years,epileptologists have been studying macroscopic electroencephalographic(EEG) recordings from the scalp to obtain global and local measures ofscalp potentials using a variety of linear, nonlinear, and dynamicalcomputational measures. On the surface of the cortex, EEG gridelectrodes have been used in the clinical setting to determine epilepticfoci. However, this approach is limited in its evaluation on the grossor macro level, which may be limited in its reach, both for treatmentand for understanding of the underlying disease in the patient.

In studies performed in vitro using recent advances in multi-siteelectrode technology, acute preparations of hippocampal recordings havegenerated the basic constructs of neuronal firing related to theepileptic condition. In conjunction with in vivo recordings in bothhumans and animals, physiologists are performing studies to infer thenormal and bursting responses of single units in excised tissue. It isrecognized that such recordings from acute and slice preparations haveprovided significant contributions to research in the epilepsy field;however they are limited by the loss of network input and output fromthe rest of the brain (slice), and inability to chronicallyspontaneously seize, as do human subjects with temporal lobe epilepsy.

Accordingly, recognition of certain neural pathways and of electricalsignificance has allowed for neuroprosthetic system development to treatepilepsy. The FDA has approved a seizure control system based onelectrical stimulation of the vagus nerve. For example, a systemmarketed by Cyberonics, Inc. (Houston, Tex.). Another system, developedby Neuropace (Mountain View, Calif.) delivers electrical stimulation tothe brain by way of subdural strips upon detection of an electricalsignal that occurs at the start of a seizure.

Despite these advances, effective neuroprosthetics capable of predictingor warning of impending seizures and delivering timely therapeuticintervention have not been developed. The hallmark of epilepsy isrecurrent seizures that are unpredictable and debilitating. Methods ofseizure prediction in real-time would have significant impact onpatients' lives. Even a few minutes of warning would allow a personexperiencing a seizure to stop driving or get out of a risky environmentto seek safety. Efforts in this area been limited by a lack ofelectrophysiologic control parameters that can be used to accuratelypredict the onset of the epileptic state and to deliver therapeuticfeedback to the affected neural structures. In currently availablesystems, overall patterns of neuronal activity associated with the onsetof seizure are detected, and upon such detection, standardized therapyis delivered to the brain in the form of electrical stimulation. Thedelivered stimulation is of pre-determined strength and duration,regardless of the strength or duration of the seizure. This lack ofcontrol results in delivery of an electrical stimulus that may either beinsufficient or excessive, both with respect to duration and stimulusstrength.

SUMMARY OF INVENTION

The invention is a device and a signal processing method that can beused with a device that can recognize and distinguish a physiologicalhigh-frequency oscillation (HFO) from a pathological high-frequencyoscillation. The signal processing method can operate near real time,and can be utilized for closed loop brain stimulation. If the signalprocessing method detects a physiological HFO in the electrical brainsignal one regimen of electrical or optogenetic brain stimulation can betriggered, alternatively if the method detects a pathological HFOassociated with epilepsy a different regimen of electrical oroptogenetic brain stimulation can be triggered. Thus, the signalprocessing method can be utilized to develop a closed loop brainstimulation device that serves the dual purpose of both enhancing memoryencoding, consolidation, and recall, or improving cognition, andreducing the probability of a seizure in a patient with epilepsy.

An embodiment of the invention is directed towards a digital signalanalysis method for distinguishing and characterizing high-frequencyoscillations in electrical recordings of brain activity. The inventionconsists of a signal processing method that is executed as computer codein the programming language Matlab (Natick, Mass.). High-frequencyoscillations are brief (20-200 msec) bursts of neurophysiologicalactivity with a spectral content ranging between (80-200 Hz) ripples and(200-600 Hz) fast ripples. High-frequency oscillations (HFOs) arebiomarkers of brain capable of generating epileptic seizures, but arealso signals associated with cognition and memory. Distinguishing andcharacterizing HFOs in electrical signals of brain activity is importantfor physicians and scientists who study and treat epilepsy, cognition,and memory. The detection and characterization of high-frequencyoscillations has several confounds that are resolved by this digitalsignal analysis method. These confounds include i) that digitalfiltering of sharp transients in brain activity can result in thegeneration and detection of false HFOs that cannot be discriminated fromtrue HFOs, ii) that digital filtering of brain activity does not easilyallow fast ripples (250-600 Hz) that co-occur with ripples (80-200 Hz)to be identified and distinguished as two distinct events, iii) thatdigital filtering of brain activity does not allow HFOs that co-occurwith inter-ictal spikes to be easily identified and classified as adistinct HFO event subset, iv) that HFOs that are generated by healthybrain regions cannot be differentiated from HFOs that are generated byepileptogenic networks. Overcoming these confounds is important because,i) false HFOs are sometimes artefactual, and the properties of HFOscannot be characterized without first excluding false HFOs, since falseHFOs do not exhibit an oscillatory frequency, power, or duration, ii)fast-ripples have a higher specificity for epileptogenic regions thanripple oscillations and occur infrequently relative to rippleoscillations, iii) ripples that co-occur with inter-ictal spikes have ahigher accuracy for epileptogenic regions, than ripples that co-occurwith background EEG oscillations, iv) ripples that occur in theneocortex during sleep may be important in mediating memoryconsolidation, while other ripples that occur in the neocortex duringsleep may be generated by epileptogenic networks prior to, or duringseizures.

A embodiment of this invention is directed towards a signal processingmethod for identifying, quantifying, characterizing, and discriminatinghigh-frequency oscillations associated with physiological processesinvolved in memory and cognition from high-frequency oscillationsinvolved in epilepsy related processes, and triggering distinct regimensof environmental or brain stimulation based on this discriminationcomprising:

(a) a computer processor; and(b) a non-transitory computer-readable memory storing instructionsexecutable by the computer processor;(c) a digital output;(d) wherein said instructions, when executed by the computer processor,perform steps comprising:

-   -   (i) applying a wavelet convolution to the electrical signals to        generate a time-frequency representation of the power of the        signal;    -   (ii) determining a region of this first time-frequency plot that        exceeds a threshold; wherein if the threshold is not met no HFO        is registered by the apparatus;    -   (iii) determining the topography of a second time-frequency plot        temporally centered around suprathreshold region of the first        time-frequency plot by identifying contours of isopower;    -   (iv) determining at least two vertices of each contour as a        coordinates of time and frequency;    -   (v) determining which contours exceed a specified threshold, and        excluding all other contours    -   (vi) determining each contour as open-loop or closed-loop based        on the coordinates of the vertices;    -   (vii) determining groups of contours based on their open- or        closed-loop classification, power level, and time-frequency        coordinates;    -   (viii) determining an event boundary contour as the closed loop        contour of lower isopower in the group that exceeds a threshold        value;    -   (ix) determining new event boundary coordinates by generating a        third time-frequency plot with a lower minimum frequency limit        than the second time-frequency plot and recalculating the event        contours and contour group, if the minimum frequency of the        original boundary contour is below a predetermined threshold;    -   (x) determining a duration of the HFO event based on the event        boundary contour;    -   (xi) determining a mean power of the HFO by calculating the mean        power magnitude across all coordinate points of the        time-frequency plot within the event boundary contour;    -   (xii) determining an amplitude-weighted mean frequency of the        HFO even within the boundary contour;    -   (xiii) determining if there are open loop contours that begin        and terminate at the upper frequency limit of the second        time-frequency plot;    -   (xiv) determining if these open loop contours are representative        of a second HFO event by calculating a fourth time-frequency        plot in a higher frequency range, identifying the region of        greatest power that exceeds a threshold, defining contours of        isopower, determining if these are open or closed loop contours,        defining groups of contours, and determining the even boundary        contour;    -   (xv) applying a distinct wavelet convolution to the electrical        signals to generate a time-frequency representation of the power        of the signal in a frequency range less than the HFO to        determine if the HFO event is superimposed on an inter-ictal        discharge, or if an inter-ictal discharge has a superimposed HFO        by performing a wavelet convolution to the electrical signals to        generate a time-frequency representation of the power of the        signal;    -   (xvi) determining the gradient plot of this TF plot;    -   (xvii) determining the borders of objects in the TF plot, and        the gradient plot of the TF plot, discharges by binarizing the        TF plot and its gradient using an appropriate threshold and        applying Moore-neighbor tracing algorithm;    -   (xviii) determining the volume of the objects in the TF plot,        and the gradient plot of the TF plot, using trapezoidal surface        integration within the object borders derived from the binarized        TF plot to the unbinarized TF plot, and gradient plot of the TF        plot;    -   (xix) determining if any of the objects are near the borders of        the TF plot, or have a height-width ratio less than a threshold        and excluding these object from further analysis;    -   (xx) determining if a object is representative of an inter-ictal        discharge by defining the object of greatest volume in the TF        plot, and object of greatest volume in the gradient plot of the        TF plot, and calculating if the volume of these objects exceeds        pre-defined thresholds;    -   (xxi) filter the electrical signals recorded from multiple        locations of a subject using an electrical sensing device to        produce a low-frequency data stream to determine if the        preferred phase angle of coupling between the HFO and bursts of        slower oscillations;    -   (xxii) transform the low-frequency data stream to produce a        low-frequency instantaneous phase; and instantaneous amplitude;    -   (xxiii) determine the start and end times of oscillatory bursts        by smoothing the instantaneous amplitude function and applying        predetermined thresholds;    -   (xxiv) determine if the HFO coincides with one or several        oscillatory burst epochs; (xxv) determine a HFO phasor with a        mean phase angle and vector strength value based on the        low-frequency burst instantaneous phase and the mean HFO event        power magnitude across the boundary counter;    -   (xxvi) determine an HFO duration, an HFO mean power, an HFO mean        frequency, and HFO phasors for all HFO events defined in the        electrical signals from multiple locations;    -   (xxvii) identify a location of the brain corresponding with the        same electrical signals determined to displays HFOs of a        predefined HFO duration, HFO mean power, HFO mean frequency, and        HFO phasors based on where the electrical signals were recorded;        and (xxviii) generating a report of the identified location of        the subject as a target for a therapeutic procedure for treating        a cause of the identified HFO; wherein    -   (xxix) for each classified high-frequency oscillation determine        the probability that the event results from a physiological        process involved with memory and cognition, or a        pathophysiological process involved with epilepsy based on the        HFO type, HFO properties, and a comparison of the phase angle of        the phasor with probability density functions of phase angles        derived from EEG and local field potential recordings from        healthy human brain areas, healthy primate brain areas, and        epileptogenic brain areas in patients with epilepsy.

A further embodiment is directed towards using a device composed of a) asubject with a plurality of electrodes; b) a brain signal acquisitiondevice to record electrical signals from multiple locations of asubject; c) a non-transitory computer-readable memory storinginstructions executable by the computer processor; d) a computerprocessor; e) digital outputs; f) a multichannel stimulator; g) asubject with a plurality of brain stimulating electrode(s) to utilizethe report to determine when and where a brain area is engaged in memoryrelated activity, or alternatively engaged in pathophysiologicalactivity associated with epilepsy or epileptic seizures the device canstimulate brain region(s) with therapeutic regimens to reduce seizures,and can also stimulate brain region(s) with therapeutic regimens toenhance memory. The brain stimulation regimen is based, in part, on thedetection, classification, quantification, and pathological probabilityof a single HFO event, and the history of a) HFO detections b) HFOclassifications, c) HFO quantifications, d) derived probabilities thatthe HFO event's phasor is related to a physiological process oralternatively a pathophysiological process described in the reportgenerated by the method.

A further embodiment is directed towards a method to identify,categorize, and quantify high-frequency oscillations using atopographical analysis of wavelet convolutions of electrical recordingsof brain activity, identifying bursts of lower-frequency oscillationsthat occur during the high-frequency oscillation, and calculating aphasor based on the instantaneous phase of the burst of the sloweroscillations during the HFO.

A further embodiment is directed towards a method for identifying,categorizing, and quantifying electrical signals known as high-frequencyoscillations (HFO) recorded from multiple locations of a subject usingan electrical sensing device and using one or more processors to:detecting electrical signals from the electrical signaling device;applying a wavelet convolution to the electrical signals to generate afirst time-frequency representation of the power of the signal;determining a region of this first time-frequency plot that exceeds athreshold; wherein if the threshold is not met no HFO is registered bythe apparatus; determining the topography of a second time-frequencyplot temporally centered around suprathreshold region of the firsttime-frequency plot by identifying contours of isopower; determining atleast two vertices of each contour as a coordinates of time andfrequency; determining which contours exceed a specified threshold, andexcluding all other contours determining each contour as open-loop orclosed-loop based on the coordinates of the vertices; determining groupsof contours based on their open- or closed-loop classification, powerlevel, and time-frequency coordinates; determining an event boundarycontour as the closed loop contour of lower isopower in the group thatexceeds a threshold value; determining new event boundary coordinates bygenerating a third time-frequency plot with a lower minimum frequencylimit than the second time-frequency plot and recalculating the eventcontours and contour group, if the minimum frequency of the originalboundary contour is below a predetermined threshold; determining aduration of the HFO based on the event boundary contour; determining amean power of the HFO by calculating a mean power magnitude across allcoordinate points of the time-frequency plot within the event boundarycontour; determining an amplitude-weighted mean frequency of the HFOwithin the event boundary contour; determining if there are open loopcontours that begin and terminate at the upper frequency limit of thesecond time-frequency plot; determining if these open loop contours arerepresentative of a second HFO event by calculating a fourthtime-frequency plot in a higher frequency range, identifying the regionof greatest power that exceeds a threshold, defining contours ofisopower, determining if these are open or closed loop contours,defining groups of contours, and determining the even boundary contour;applying a distinct wavelet convolution to the electrical signals togenerate a time-frequency representation of the power of the signal in afrequency range less than the HFO to determine if the HFO issuperimposed on an inter-ictal discharge, or if an inter-ictal dischargehas a superimposed HFO by performing a wavelet convolution to theelectrical signals to generate a time-frequency representation of thepower of the signal (TF Plot); determining the gradient plot of this TFplot; by calculating both the horizontal gradient of the TF plot

${\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}$

and the vertical gradient of the TF plot

${\nabla P_{f}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}$

and combining these two gradients as ∇F_(map)=√{square root over((∇P_(f))²+(∇P_(t))²)}; determining the borders of objects in the TFplot, and the gradient plot of the TF plot, discharges by binarizing theTF plot and its gradient using an appropriate threshold and applyingMoore-neighbor tracing algorithm; determining the volume of the objectsin the TF plot, and the gradient plot of the TF plot, using trapezoidalsurface integration within the object borders derived from the binarizedTF plot to the unbinarized TF plot, and gradient plot of the TF plot;determining if any of the objects are near the borders of the TF plot,or have a height-width ratio less than a threshold and excluding theseobject from further analysis; determining if an object is representativeof an inter-ictal discharge by defining the object of greatest volume inthe TF plot, and object of greatest volume in the gradient plot of theTF plot, and calculating if the volume of these objects exceedspre-defined thresholds; filtering the electrical signals recorded frommultiple locations of a subject using an electrical sensing device toproduce a low-frequency data stream to determine if the preferred phaseangle of coupling between the HFO and bursts of slower oscillations;transforming the low-frequency data stream to produce a low-frequencyinstantaneous phase; and instantaneous amplitude; determining the startand end times of an oscillatory burst by smoothing the instantaneousamplitude function and applying predetermined thresholds; determining ifthe HFO coincides with one or several oscillatory burst epochs;determining a HFO phasor with a mean phase angle and vector strengthvalue based on the low-frequency burst instantaneous phase and the meanHFO event power magnitude across the boundary counter; determining anHFO duration, an HFO mean power, an HFO mean frequency, and HFO phasorsfor all HFO events defined in the electrical signals from multiplelocations; identifying a location of the brain corresponding with thesame electrical signals determined to displays HFOs of a predefined HFOduration, HFO mean power, HFO mean frequency, and HFO phasors based onwhere the electrical signals were recorded; and generating a report ofthe identified location of the subject as a target for a therapeuticprocedure for treating a cause of the identified HFO.

A further preferred embodiment is directed towards a system foridentifying brain electrical activity displaying high-frequencyoscillations, comprising: a data acquisition device for receiving anelectrical signal sensing device configured to record electrical signalsfrom multiple locations of the patient; a memory storage system forstoring instructions; and a microprocessor communicatively coupled tothe memory storage system, the microprocessor being configured toexecute instructions stored in the memory storage system to cause thesystem to: record, using the electrical signal sensing device,electrical signals from multiple locations in the brain of a subject;filter the electrical signals to produce a high frequency oscillation(HFO) data stream and a low-frequency data stream; apply independentcomponent analysis to the HFO data stream and removing noise from theHFO data stream; determine the location of HFO events in the HFO datastream; apply a wavelet convolution to the electrical signals at thelocation of HFO events to generate a time-frequency plot representationof the power of the signal; determine a region of the firsttime-frequency plot that exceeds a threshold; wherein if the thresholdis not met no HFO is registered by the apparatus; determine thetopography of a second time-frequency plot temporally centered aroundsuprathreshold region of the first time-frequency plot by identifyingcontours of isopower; determine at least two vertices of each contour asa coordinates of time and frequency; determine which contours exceed aspecified threshold, and excluding all other contours; determine eachcontour as open-loop or closed-loop based on the coordinates of thevertices; determine groups of contours based on their open- orclosed-loop classification, power level, and time-frequency coordinates;determine an event boundary contour as the closed loop contour of lowerisopower in the group that exceeds a threshold value; determine newevent boundary coordinates by generating a third time-frequency plotwith a lower minimum frequency limit than the second time-frequency plotand recalculating the event contours and contour group, if the minimumfrequency of the original boundary contour is below a predeterminedthreshold; determine a duration of the HFO event based on the eventboundary contour; determine a mean power of the HFO by calculating themean power magnitude across all coordinate points of the time-frequencyplot within the event boundary contour; determining anamplitude-weighted mean frequency of the HFO even within the boundarycontour; determine if there are open loop contours that begin andterminate at the upper frequency limit of the second time-frequencyplot; determine if these open loop contours are representative of asecond HFO event by calculating a fourth time-frequency plot in a higherfrequency range, identifying the region of greatest power that exceeds athreshold, defining contours of isopower, determining if these are openor closed loop contours, defining groups of contours, and determiningthe even boundary contour; applying a distinct wavelet convolution tothe electrical signals to generate a time-frequency representation ofthe power of the signal in a frequency range less than the HFO todetermine if the HFO event is superimposed on an inter-ictal discharge,or if an inter-ictal discharge has a superimposed HFO by performing awavelet convolution to the electrical signals to generate atime-frequency representation of the power of the signal (TF plot);determine the gradient plot of this TF plot; by calculating both thehorizontal gradient of the TF plot

${\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}$

and the vertical gradient of the TF plot

${\nabla P_{f}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}$

and combining these two gradients as ∇F_(map)=√{square root over((∇P_(f))²+(∇P_(t))²)}; determine the borders of objects in the TF plot,and the gradient plot of the TF plot, discharges by binarizing the TFplot and its gradient using an appropriate threshold and applyingMoore-neighbor tracing algorithm; determine the volume of the objects inthe TF plot, and the gradient plot of the TF plot, using trapezoidalsurface integration within the object borders derived from the binarizedTF plot to the unbinarized TF plot, and gradient plot of the TF plot;determine if any of the objects are near the borders of the TF plot, orhave a height-width ratio less than a threshold and excluding theseobject from further analysis; determine if an object is representativeof an inter-ictal discharge by defining the object of greatest volume inthe TF plot, and object of greatest volume in the gradient plot of theTF plot, and calculate if the volume of these objects exceedspre-defined thresholds; filter the electrical signals recorded frommultiple locations of a subject using an electrical sensing device toproduce a low-frequency data stream to determine if the preferred phaseangle of coupling between the HFO and bursts of slower oscillations;transform the low-frequency data stream to produce a low-frequencyinstantaneous phase; and instantaneous amplitude; determine the startand end times of oscillatory bursts by smoothing the instantaneousamplitude function and applying predetermined thresholds; determine ifthe HFO coincides with one or several oscillatory burst epochs;determine a HFO phasor with a mean phase angle and vector strength valuebased on the low-frequency burst instantaneous phase and the mean HFOevent power magnitude across the boundary counter; determine theprobability that a HFO resulted from either a process involved withmemory and cognition, or a pathophysiological process involved withepilepsy on the basis of a comparison of the HFO duration, HFO meanpower, HFO mean frequency, and HFO phasor with a pre-existing databaseof the values of these parameters; identify a location of the braincorresponding with the same electrical signals determined to displaysHFOs of a predefined HFO duration, HFO mean power, HFO mean frequency,HFO phasors, and pathological HFO probability, based on where theelectrical signals were recorded; and generate a report of theidentified location of the subject as a target for a therapeuticprocedure for treating a cause of the identified HFO events.

A further embodiment is directed towards non-transitory computerreadable medium storing instructions that, when executed by a processor,are configured to identify brain electrical activity displaying of apredefined HFO duration, HFO mean power, HFO mean frequency, and HFOphasor were recorded by: receiving electrical signals recorded frommultiple locations in the brain of a subject using an electrical signalsensing device; filtering the electrical signals to produce a highfrequency oscillation (HFO) data stream and a low-frequency data stream;applying independent component analysis to the HFO data stream andremoving noise from the HFO data stream; determining the location of HFOevents in the HFO data stream; applying a wavelet convolution to theelectrical signals at the location of HFO events to generate atime-frequency representation of the power of the signal; determining aregion of this first time-frequency plot that exceeds a threshold;wherein if the threshold is not met no HFO is registered by theapparatus; determining the topography of a second time-frequency plottemporally centered around suprathreshold region of the firsttime-frequency plot by identifying contours of isopower; determining atleast two vertices of each contour as a coordinates of time andfrequency; determining which contours exceed a specified threshold, andexcluding all other contours; determining each contour as open-loop orclosed-loop based on the coordinates of the vertices; determining groupsof contours based on their open- or closed-loop classification, powerlevel, and time-frequency coordinates; determining an event boundarycontour as the closed loop contour of lower isopower in the group thatexceeds a threshold value; determining new event boundary coordinates bygenerating a third time-frequency plot with a lower minimum frequencylimit than the second time-frequency plot and recalculating the eventcontours and contour group, if the minimum frequency of the originalboundary contour is below a predetermined threshold; determining aduration of the HFO event based on the event boundary contour;determining a mean power of the HFO by calculating the mean powermagnitude across all coordinate points of the time-frequency plot withinthe event boundary contour; determining an amplitude-weighted meanfrequency of the HFO even within the boundary contour; determining ifthere are open loop contours that begin and terminate at the upperfrequency limit of the second time-frequency plot; determining if theseopen loop contours are representative of a second HFO event bycalculating a fourth time-frequency plot in a higher frequency range,identifying the region of greatest power that exceeds a threshold,defining contours of isopower, determining if these are open or closedloop contours, defining groups of contours, and determining the evenboundary contour; applying a distinct wavelet convolution to theelectrical signals to generate a time-frequency representation of thepower of the signal in a frequency range less than the HFO to determineif the HFO event is superimposed on an inter-ictal discharge, or if aninter-ictal discharge has a superimposed HFO by performing a waveletconvolution to the electrical signals to generate a time-frequencyrepresentation of the power of the signal (TF plot); determining thegradient plot of this TF plot; by calculating both the horizontalgradient of the TF plot,

${{\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}};$

and the vertical gradient of the TF plot,

${{\nabla P_{f}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}};$

and combining these two gradients as, ∇TF_(map)=√{square root over((∇P_(f))²+(∇P_(t))²)}; determining the borders of objects in the TFplot, and the gradient plot of the TF plot, discharges by binarizing theTF plot and its gradient using an appropriate threshold and applyingMoore-neighbor tracing algorithm; determining the volume of the objectsin the TF plot, and the gradient plot of the TF plot, using trapezoidalsurface integration within the object borders derived from the binarizedTF plot to the unbinarized TF plot, and gradient plot of the TF plot;determining if any of the objects are near the borders of the TF plot,or have a height-width ratio less than a threshold and excluding theseobject from further analysis; determining if an object is representativeof an inter-ictal discharge by defining the object of greatest volume inthe TF plot, and object of greatest volume in the gradient plot of theTF plot, and calculating if the volume of these objects exceedspre-defined thresholds; filtering the electrical signals recorded frommultiple locations of a subject using an electrical sensing device toproduce a low-frequency data stream to determine if the preferred phaseangle of coupling between the HFO and bursts of slower oscillations;transforming the low-frequency data stream to produce a low-frequencyinstantaneous phase; and instantaneous amplitude; determining the startand end times of oscillatory bursts by smoothing the instantaneousamplitude function and applying predetermined thresholds; determining ifthe HFO coincides with one or several oscillatory burst epochs;determining a HFO phasor with a mean phase angle and vector strengthvalue based on the low-frequency burst instantaneous phase and the meanHFO event power magnitude across the boundary counter; determining theprobability that a HFO resulted from either a process involved withmemory and cognition, or a pathophysiological process involved withepilepsy on the basis of a comparison of the HFO duration, HFO meanpower, HFO mean frequency, and HFO phasor with a pre-existing databaseof the values of these parameters; identifying a location of the braincorresponding with the same electrical signals determined to displaysHFOs of a predefined HFO duration, HFO mean power, HFO mean frequency,HFO phasors, and pathological HFO probability, based on where theelectrical signals were recorded; and generating a report of theidentified location of the subject as a target for a therapeuticprocedure for treating a cause of the identified HFO events.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B depict simulations showing proof of concept oftopographical analysis of time-frequency plots used by the method

FIGS. 2A-2D depict results of simulations of the topographical detectionand quantification of HFOs in EEG used by the method.

FIGS. 3A and 3B depict results of the topographical detection andquantification of HFOs in human EEG recordings by the method.

FIG. 4 depicts result of the topographical detection and quantificationof distinct ripple and fast-ripple events in human EEG recordings by themethod.

FIG. 5 depicts results of the method applied to human EEG in definingthe ratio of ripple on spike and ripple on oscillation events that occurin the seizure-onset zone relative to outside the seizure-onset zone.

FIG. 6 depicts results of the method applied to human EEG indistinguishing the HFO properties in the seizure-onset zone relative tooutside the seizure-onset zone.

FIGS. 7A and 7B depict results of the topographical analysis of the TFplot to detect inter-ictal discharges by the method.

FIG. 8 depicts results of the topographical analysis of the TF plot toidentify inter-ictal discharges and ripples on spikes in EEG recordingsfrom the scalp by the method.

FIG. 9 depicts results of the topographical analysis of the TF plot todetect and quantify a fast ripple used by the method.

FIGS. 10A-10D depict an illustration of the phase angles of oscillationscoupled with ripple events during sleep.

FIG. 11 depicts an illustration of the detection of oscillatory burstsand the classification of ripples using a defined taxonomy used by themethod.

FIGS. 12A-12D depict an example of the derivation of ripple phasors, andthe identification of a bimodal distribution of the preferred phaseangle of coupling in defined neuroanatomical regions used by the method.

FIG. 13 depicts an example of the distinction of the seizure-onset zone,and non-seizure onset zone in the parietal lobe of patients withneocortical epilepsy based on the preferred phase angle of coupling usedby the method.

FIGS. 14A and 14B depict incidence ratio of ripples occurring in thepeak-trough or trough-peak distribution in the seizure onset zone usedby the method.

FIG. 15 depicts a diagram of the a device for capturing electricalsignals from the brain suitable for performing an embodiment of themethod described herein.

DETAILED DESCRIPTION OF THE EMBODIMENTS

In both manual and automated HFO detection, it is common practice tofirst apply a high pass filter to the continuous intracranial EEG (iEEG)or local field potential (LFP) recordings. After high-pass filtering,HFOs can be observed visually or detected automatically as an increasein the signal amplitude above a threshold of 3-5 standard deviations ofthe mean for at least three oscillatory cycles.

However, when sharp transients such as inter-ictal epileptiform spikes(IES) are band-pass filtered a sinusoid-like waveform resembling an HFOcan result. The energy spread over a continuous broad frequency range isdue to how transients are represented in the frequency space, becausethe Fourier transform of a Dirac impulse is a constant.

One strategy for distinguishing true HFOs from false HFOs is based ontime-frequency analysis using wavelets. A wavelet convolution ortransform of a sharp transient appears as a “candle” with a gradual andcontinuous taper in power with increasing frequency, while a trueoscillation appears as a distinct “blob” of power in time-frequencycoordinates.

We utilized the difference in the time-frequency representation of sharptransients and true high-frequency oscillations, to develop an automaticsoftware method for classifying and quantifying ripples. Time-frequencymaps of time series have an inherent topography defined by isopowercontours. A true ripple is represented by a “blob” of power within theripple band (80-250 Hz) and if contour lines are defined for atime-frequency representation of the “blob”, with the maximum andminimum frequencies constrained to the ripple band, the contours willhave closed loops. In contrast, a false ripple is represented by a“candle” of power in the ripple band, but importantly this “candle”extends below the ripple band. Therefore, when the contour lines aredefined for the “candle” within the ripple band, the contours will haveopen loops. In the current study we tested whether the open-, orclosed-loop properties of time-frequency plot contour lines could beused to differentiate true- and false-ripples on spikes i.e.epileptiform discharges, and whether analysis of the contour lines couldbe used to define ripple spectral content, power, and duration.

Patients:

Recordings were selected from patients who underwent intracranialmonitoring with depth electrodes between 2014 and 2016 at University ofCalifornia Los Angeles (UCLA) and 2016-2017 at Thomas JeffersonUniversity (TJU) for the purpose of localization of the seizure onsetzone. The inclusion criteria were at least one night and day ofintracranial recording with 2000 Hz sampling rate and at least 4 h of vEEG uninterrupted by seizures. All clinical data from the patient'sinpatient and postsurgical follow-up charts were provided. Patientsunderwent pre-surgical magnetic resonance imaging (MRI) and stereotacticelectrode implantation, as well as a CT scan to localize electrode and apostsurgical MRI after the respective surgery. This study was approvedby the UCLA institutional review board, and TJU institutional reviewboard.

EEG Recordings and Segment Selection:

Clinical iEEG (0.1-600 Hz; 2,000 samples per second; reference scalp Fz)was recorded from 7-contact depth electrodes using a Nihon-Kohden256-channel JE-120 long-term monitoring system (Nihon-Kohden America,Foothill Ranch, Calif., U.S.A.). The recordings were acquired during a35-60 min epoch of mixed-stage sleep. Sleep was confirmed by video-EEGinspection revealing K-complexes, spindles, slow waves, and a paucity ofmuscle artifact. We did not perform concurrent electrooculography (EOG)and electromyography (EMG) recordings. One-second trials of ripplesoccurring on inter-ictal discharges were identified using a previouslydescribed algorithm. In brief, 1) INFOMAX independent component analysiswas applied to referential recordings to reduce muscle contamination,and demarcate artefactual ripple events produced by muscle contamination(US20150099962A1) (WO2017143319A1) 2) ripples were detected using aHilbert detector applied to the band-pass filtered and ICA processedsignal, 3) for each ripple detected a one-second trial was generatedwith a ripple centered at 0.5 seconds, 4) To distinguish ripples thatoccur during epileptiform spikes from all other ripples, we utilized avalidated method. We calculated the derivative of the peri-rippleband-pass filtered (4-30 Hz) iEEG and applied a threshold of 4 μN/msec.If the one second iEEG trials containing ripple events exceeded thisthreshold within +/−50 msec that ripple was included for subsequentanalysis. All the analysis in this study was performed using customsoftware written in Matlab 2016b (Natick, Mass.).

Upon collection of data, we can then process the data in a new andmeaningful way. Furthermore, by identifying true events, we can treatthe patient with electrical stimulation to increase memory or engagememory or to impact the brain to reduce or eliminate seizure activity orother activity having deleterious effects on the brain.

Wavelet Convolution:

A time-frequency analysis of the iEEG recording was performed using awavelet convolution in the time domain. Complex Morlet wavelets werecreated with constant frequency domain width

${\frac{f_{o}}{\sigma_{f}} = 7},$

Where f_(o) is the wavelet central frequency and σ_(f) is the standarddeviation of its Gaussian envelope in the frequency domain. The centralfrequency, and the standard deviation of the Gaussian envelope valueswere frequency dependent and varied between the lower and upper limitsof the TF analysis. The Gaussian width of the wavelet was set to 5standard deviations. Prior to performing the wavelet convolution, thedigital recording of the brain signal was padded with zeros until thesample count was equal to the closest power of two greater than theinitial number of samples. The time frequency plot was not normalized.Ripple events occur within a range of 80-200 Hz. Due to boundary effectscaused by continuous wavelet convolution of finite-length signals, arange of 50-240 Hz was selected for the time-frequency (TF) plot inorder to buffer the frequency range of interest. We also discarded theinitial and final 45 msec of the time-frequency (TF) plot to reduceboundary effects.

Topographical Analysis of the Time-Frequency Plot:

The topographical analysis of the TF plot was performed by calculating acontour map consisting of 50 contours of isopower in the region of theTF plot centered on the candidate event, determined by the Hilbertdetector, and including 100 milliseconds prior to the event, and 100milliseconds after the event. Over the total range of power values inthe TF plot, 50 contour levels were computed and scaled as equal dataunit lengths. Contours corresponding to power values less than athreshold defined by0.2*((max_(tf-power)-min_(tf-power))+min_(tf-power)) were removed. Themethod next identified all the vertices of each of the remainingisolines of constant power in the TF map. Thus each contour wasdescribed by its power magnitude level, and the time/frequencycoordinates of its vertices.

Defining Groups of Open- and Closed-Loop Contours

A power threshold was then applied to each of the 50 isolines ofconstant power in the TF plot of the candidate event, and contours belowa power threshold were removed. Each of the remaining contours wassubsequently classified as closed if the contour's first and last vertexcoordinate was identical, and open if the first and last vertex weredistinct. Groups of closed-loop contours, which either surround or aresurrounded by other closed-loop contours, were identified. If, in agroup, the contour with the highest power level surrounded the othermembers of that group, the group was identified as a valley and removedfrom the time-frequency map. Groups containing fewer than 3 closed-loopcontours were categorized as a ‘lone contour group’ and were removedfrom consideration. If one or more closed-loop contour groups remained,the candidate true ripple on spike event is identified as the groupassociated with the highest local maximum. In this study, all 1-secondiEEG trials that were analyzed using the topographical approach werebelieved to contain either a ripple oscillation, and/or inter-ictalepileptiform discharge. In the case that neither of these events werepresent in the trial, then the detector would still define.

Quantifying Ripple on Spike Duration, Power, and Spectral Content:

In contrast to HFO detectors that band-pass filter the recordings(US20150099962A1, US20170311870A1, US20160045127A1), or also apply awavelet transforms (U.S. Pat. No. 9,326,698B2) and use amplitude and/orpower based criteria to identify HFO events, the method described hereinidentified distinct objects in the time-frequency plot to using atopographical analysis to identify, classify and quantify HFO events.Only closed-loop contours that surround event maximum and are greaterthan the detection threshold were considered for property extraction.The contour at the lowest power level was selected as the event boundarycontour B′. The region of the TF map within this boundary was defined asthe ripple event, from which the relevant properties were be extracted.Four properties were extracted from the event region. The first two werethe times of event onset and offset for determination of the eventduration. These onset and offset times were defined as the minimum andmaximum time coordinates associated with the vertices of the boundarycontour. The power of the HFO was then determined by calculating themean power across all coordinate points of the TF map within theboundary B. Finally, the amplitude-weighted mean frequency of the HFOevent was calculated using:

$\begin{matrix}{\overset{\_}{f_{hfo}} = {\Sigma_{i}^{B}\frac{f_{i}*P_{i}}{\Sigma \mspace{14mu} P_{i}}}} & {{eqn}.\mspace{14mu} 1}\end{matrix}$

where f_(i) and P_(i) and are the frequency and power amplitude ofcoordinate of the TF map within the boundary contour, B.

Illustrating Detector Methodology Using Simulated Data:

We used Gaussian functions of varying duration to simulate inter-ictalepileptiform spikes in computer generated 1 second data segments with a2 kHz sampling rate. The Gaussians were generated using the functiongausswin.m with σ=2, 3.3, 6.7. We generated simulated ripples using asine wave function with a frequency of 140 Hz and an amplitude of 350μV, to correspond with the respective amplitude of the Gaussianfunction. A Blackman window was applied to the sine wave for the purposeof amplitude modulation. A simulated ripple on epileptiform spike wascreated by combining the Gaussian function (a=6.7) with the simulatedripple.

Quantifying Detector Performance Using Simulated Data:

A 1-second 2 kHz sampled iEEG trial was selected from one patient tocalculate surrogate trials for the simulation study. This trial wasselected on the basis of the absence of a ripple or inter-ictalepileptiform spike. We computed the fast fourier transform of this iEEGtrial (fft.m) for all frequencies less than the Nyquist frequency in 1Hz bins. The imaginary components of the FFT were permuted usingrandperm.m. A iEEG surrogate trials was derived from the original iEEGtrial using an inverse fast fourier transform (ifft.m) of the real andpermuted imaginary components of the original iEEG trial. A simulatedripple with a frequency of 100 Hz and a duration of 0.0268 seconds wasgenerated using a sine function enveloped by a Gaussian window of theform

$e^{{- \frac{1}{2}}{(\frac{2{\alpha {({n + \frac{N}{2} + 1})}}}{N - 1})}^{2}}$

with α=75. The amplitude of the sine function ranged from 2-30 μV in 2μV steps to simulate varying ripple intensities. The simulated ripplewas superimposed at 0.5 seconds on the 1000 permuted iEEG trials.

Validation of Detector Accuracy by Visual Inspection:

The classification of ripple on spike events as true or false wasvalidated using visual inspection of a custom display of the raw andprocessed data. In a single window each trial was displayed as 1) theunfiltered one second iEEG recording trial, 2) the iEEG trial followingband-pass (80-240 Hz) filtering using a 500^(th) order digital FIRfilter, 3) vertical guidelines located at the peaks, and troughs (blue)of the band-pass filtered signal superimposed on the unfiltered andfiltered iEEG trial, 4) the TF plot, 5) the isopower contour linesresulting from the topographical analysis, 6) the candidate closed-loopcontour group, or open-loop contour group.

Defining True and False High-Frequency Oscillations:

To test the accuracy of the detector to discriminate true from falseripples on spikes (RonS), we manually separated true and false RonSusing the following criteria. A true RonS corresponded with a visibleripple superimposed on the spike in the unfiltered iEEG, and the peaksand troughs of the ripple component of the RonS were largely alignedwith the peaks and troughs respectively of the RonS after band-pass(80-240 Hz) filtering. In contrast, a false RonS was not visibleevidence of ripple on the spike or when present had no temporalalignment between the peaks and troughs of the unfiltered and theband-pass filtered signal.

Identification of Superimposed Inter-Ictal Discharges in the iEEG Usinga Topographical Analysis of Time-Frequency Plots:

Both true and false ripple events were subsequently processed by asecond stage algorithm designed to identify the presence of aninter-ictal discharge, within 200 ms of the ripple event, on the basisof an analysis of TF plots resulting from wavelet convolution. Thisalgorithm operated under the principle that inter-ictal dischargesproduce a recognizable motif in TF plot that is relatively independentof both the amplitude and slope of the iEEG during the discharge. Thenovel detector sought to identify this motif by using a topographicalanalysis of the TF plot that identified and characterized distinctelevations in both the power, and the gradient of the power, in TFspace. These elevations represent objects and we hypothesized thatobjects that met certain criteria would always correspond withinter-ictal epileptiform spike events. We identified these candidateevents by first creating objects by thresholding the TF plot and itsgradient to values >20% of the maximum. After applying this threshold itwas possible to define the borders of the objects in the resulting TFplot, and its gradient, by using this same threshold to derive a binarymap. We subsequently calculated the volume of each object, within itsdefined boundaries, using a trapezoidal surface integration for each ofthe objects. To determine if any of the identified and characterizedobjects were representative of inter-ictal epileptiform spikes weapplied separate thresholds to the derived volumes for the objects inthe TF plot and its gradient. Specifically, the iEEG trials wereprocessed using a real Morlet-based wavelet convolution to compute theTF map.

The wavelets were created with constant frequency domain width,

$\frac{f_{o}}{\sigma_{f}} = 6.$

We analyzed the portion of the resulting TF plot centered around thedetected ripple event ±200 ms. We derived a gradient plot of the TF plotby calculating both the horizontal gradient of the TF plot,

${{\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}};$

and the vertical gradient of the TF plot,

${{\nabla P_{f}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}};$

and combining these two gradients as,

∇F _(map)=√{square root over ((∇P _(f))²+(∇P _(t))²)}

To define the thresholds for both the TF plot and its gradient used todefine the object boundaries we used 20% of the respective maximumvalues. Following binarization of the maps using this threshold weidentified the boundary coordinates of each object using aMoore-neighbor tracing algorithm modified by Jacob's stopping criteria.We then determined the volume of each object within its boundaries byapproximating the surface integral using trapezoidal numericalintegration.

To identify the objects that corresponded to inter-ictal epileptiformspikes, we first identified the object with the greatest power maximumvalue. We then determined if the volume of this object met apredetermined threshold and if in the gradient plot correspondingobjects also met a predetermined threshold. The correspondence of theobject in the time-frequency plot and the objects in the gradient plotwas confirmed by measuring the distance between the centroids of theseobjects. Due to edge effect we excluded objects in the TF plot that hada power maximum value near the TF plot borders. We also excluded objectsthat had a height-width ratio less than 0.7, because these objects moreoften represented bursts of gamma oscillations.

Illustration of Detector Principles:

On the basis of these operational definitions, and assumptions weapplied the detector to simulated data to illustrate how a topographicalanalysis of time frequency spectrograms could differentiate true andfalse ripples on spikes. The time frequency plots of Gaussians withdurations of σ>1.0 ms were described by a set of open-loop contours ofisopower (OLCs) extending up from the lower frequency limit (80 Hz),reaching a peak frequency inversely proportional to the duration of theGaussian signal (FIG. 1A1, 2). When the duration of the Gaussian wasdecreased to σ˜1.0 ms, a group of closed-loop contours of isopower(CLCs) were evident (FIG. 1A3). Since no true ripple oscillation waspresent during the Gaussians, the peaks and troughs of the band-passfiltered simulated signals showed incomplete correspondence with the rawsimulated signal (FIG. 1A1-3). A simulated ripple event resulted in aCLC group of isopower centered at the simulated ripple's mean frequency(FIG. 1B1, light region). In this case, the peaks and troughs of theband-pass filtered signal did coincide with the raw simulated signal(FIG. 1B1, top black and light waveform). When the simulated rippleevent was combined with a Gaussian the detector registered a set of OLCsextending from the lower frequency limit and a CLCs group centered atthe ripple's mean frequency (FIG. 1B2, light), and the peaks and troughsof the raw signal corresponded with the peaks and troughs of theband-pass filtered signal (FIG. 1B2, top black and light waveform).

Measuring Detector Performance Using Simulated Data:

Using simulated iEEG data, we sought to determine the stability andvariability of ripple identification and characterization. Ripples of apredetermined magnitude, identical in duration and spectral content,were superimposed on simulated iEEG trials generated by randomlypermuting the phase component of patient's 1 second a featureless iEEGrecording. Since the topographical algorithm is designed to alwaysidentify a closed or open loop contour group true or false ripple event,regardless of whether either is actually present the power of the group,we first asked what fraction of the simulated iEEG trials, lacking asuperimposed simulated ripple, would result in a closed loop contour.Thus, the algorithm was first used to process simulated trials with nosuperimposed ripple in order to assess in what ways background iEEG maytrigger false positive detections and to examine the behavior of thecalculated features. We found that when no ripple was present in thesimulated data, the detector identified closed loop groups in 41.5% ofbackground iEEG trials with no superimposed ripple oscillation resultedin a CLC group, triggering a false positive detection the trials (FIG.2A). The mean average power magnitude detected for these false positiveevents corresponded to ripple amplitudes <5 uV (FIG. 2B). (max averagepower less than mean average power for ripples with 5 uV amplitudes). Wenext introduced the superimposed ripple to the simulated iEEGbackground. We found that the probability of false negative rippleidentification decreased exponentially with increasing simulated rippleamplitude. As the simulated ripple amplitude was increased, the averagepower weighted mean frequency estimated by the detector approached afrequency of 101.6 Hz, slightly above the simulated frequency of thesimulated ripple of 100 Hz. The standard deviation of the averagefrequency of the detected ripple decreased exponentially (FIG. 2C).Increasing the amplitude of the simulated ripple corresponded with anincrease in the power of the identified ripple, as well as an increasein the standard deviation of this measurement (FIG. 2B). Finally, theincreasing amplitude also corresponded with a decrease in thevariability of the detected ripple duration. The simulated rippleduration was consistently underestimated by the topographical method(FIG. 2D).

iEEG Visual Verification and Detector Performance:

The detector was applied to 25,011 one-second iEEG trials, recorded from12 patients undergoing intracranial monitoring with depth electrodesthat recorded RonS events. In all these trials the detector coulddifferentiate the true RonS trials from the false RonS trials, andcharacterize the properties of the former. False RonS have no meanspectral content, or centroid of power since they result from Gibb'sphenomenon. We randomly selected 2,934 trials for visual verification. Atrue positive was defined as a trial in which the detector identified aCLC group, a true RonS event was clear in the raw signal, and, as weassumed, the peaks and troughs of the raw signal corresponded with thoseof the band-pass filtered signal (FIG. 3A1, 2). A false positive wasdefined as an instance in which the detector identified a CLC group, buta true RonS event was not clear in the raw signal. True negative casescorresponded to sharply contoured inter-ictal discharges without ripplesi.e. false RonS (FIG. 3B1, 2). A true negative was defined as aninstance in which the detector identified only sets of OLCs, a ripplewas not evident in the raw signal. A false negative was defined as acase in which the detector only identified sets of OLCs when a true RonSwas evident in the raw iEEG signal, or alternatively if the trial failedto exhibit an epileptiform discharge. Across all patients, the detectorsaccuracy was 88.5±2.1%, with a sensitivity of 81.8±3.4%, a specificityof 95.2±0.81%, a precision of 94.5±1.8%, and a negative predictive valueof 84.0±3.9% (s.e.m, n=12). For all the patients, a second reviewervisually validated the detector performance with a Cohen's kappa equalto 0.37, kappa values for individual patients ranged between0.11-0.6152.

Properties of Detected Ripples:

We examined the properties of the true RonS events that were identifiedby the detector and visually verified. For each detected RonS event, themean power, power-weighted mean frequency, and event duration werequantified. For the combined verified trials, the true RonS had a meanfrequency of 109.4±24.7 Hz. The detector had the capability ofdistinguishing fast ripples from ripples, an example of which can beseen in FIG. 4. The true RonS had a mean power magnitude of 47.9±175.6*

10

{circumflex over ( )}5 arbitrary units, and a mean duration of 20.5±12.8ms True RonS power magnitude was inconsistent across individual trials,electrodes, and patients. Mean event duration was also variable, but themean duration corresponded to only two cycles of the mean RonSoscillation period.

Accuracy of the Detected Ripples for the Seizure Onset Zone:

We next addressed whether or not the rates of the different ripple typesquantified by the detector could be used to distinguish the SOZ. For all16 patients, including the five patients with iEEG recordings performedintra-operatively, the mean ripple rates of true and false ripples onspikes recorded inside the SOZ was almost always greater as comparedwith the non-SOZ (NSOZ), however this was less often the case forripples on oscillations (FIG. 5). Notably, true and false ripples onspikes were similar with respect to the SOZ rate ratio that compares themean ripple rate in the SOZ with the mean ripple rate in the NSOZ (n=16,p=0.21, paired t-test, FIG. 4). In contrast, the SOZ rate ratio forripples on oscillations was decreased with respect to the true rippleson spikes (n=16, p<0.01, paired t-test, FIG. 4A). These differencesbetween the ripple types were also evident in the recordings analyzed inbipolar montage. Overall, the SOZ rate ratios derived from therecordings in referential montage were slightly increased as comparedwith the SOZ rate ratios derived from the bipolar montage recordings.This difference met statistical significance for the false ripple onspike SOZ rate ratio (paired t-test, n=16 p<0.05). We also generatedreceiver operating characteristic (ROC) curves for classifying theseizure onset zone on the basis of unscaled ripple rate measurementsacross all patients in either the sleep, or intra-operative patientcohorts (FIG. 5). Unfortunately, the sample size was too small toaddress statistical significance of changes in the montage using the ROCmethodology. Overall, the classification accuracy of true and falseripple on spike rates for the seizure onset zone was good and the areaunder the ROC (AUROC) was >76%.

Differences in the Spectral Content and Power of Ripples Inside andOutside the SOZ:

We next asked if the properties of ripples, such as spectral content orpower, differed depending on whether the event was generated in the SOZor NSOZ. For true ripples on spikes measured using referential montageit appeared that the events recorded from the NSOZ were of a lowerspectral content and lower power as compared with the events recordedfrom the SOZ. A two-dimensional Kolmogorov-Smirnov test confirmed thatthe populations or ripple events in the SOZ and NSOZ were distinct whenclassified by spectral content and power (KS=0.239, p=7.6e-11, FIG. 6).A similar difference was also seen for the events measured during theintra-operative referential montage recordings (KS=0.362, p=3.8e-13,FIG. 6). In contrast, the properties of ripples on oscillations did notstrongly depend on whether they were generated in the SOZ or NSOZ(KS=0.167, p=4.3e-5, FIG. 6). The use of bipolar montage recordingsreduced the differences between the properties of true ripple on spikeevents generated in the SOZ as compared with the NSOZ (KS=0.174,p=0.1.3e-5).

Topographical Identification of Inter-Ictal Discharges:

To demonstrate the validity of inter-ictal discharge detection usingwavelet convolution and topographical analysis we inspected iEEGrecordings annotated by the analysis. We found that across the patientsthe sensitivity and specificity of inter-ictal spike detection rangedbetween 80.0-95.9%. FIG. 7A exhibits a EEG tracing with an inter-ictaldischarge, FIG. 7B exhibits the corresponding binarized time-frequencyplot, and the binarized gradient of the time-frequency plot with thederived borders of the objects shown in grey, FIG. 7C shows theunbinarized time-frequency plot, and gradient of the time-frequency plotin this case the object volumes exceeded the threshold.

Detection of Spikes and Ripples on Spikes in Scalp EEG:

To demonstrate that the process can be applied both to intracranial EEGand recordings from scalp EEG, in three human scalp recordings with a 2kHz sampling rate, obtained at Thomas Jefferson University, we firstutilized independent component analysis to identify scalp EEG epochsthat were not contaminated by artifact (US20150099962A1,WO2017143319A1), we then identified epochs of EEG that were candidateinter-ictal spike events by transforming the recording and using aDebauchies 8 (db8) wavelet, calculating the derivative of thetransformed data, and applying a threshold. A second stage ofinter-ictal discharge detection utilized the wavelet convolution andtopographical analysis (FIG. 8A). If an inter-ictal discharge wasdetected, we also utilized wavelet convolution and topographicalanalysis to identify high-frequency oscillations (FIG. 8B).

Detection of Fast Ripples in Intracranial EEG:

Detection of fast ripples in intracranial EEG: Fast ripple detectionincludes the same process as described above, with certainspecifications changed. During the wavelet convolution, complex Morletwavelets were created with constant frequency domain width of 10, and aGaussian width of 4 standard deviations. The frequency range of interestis set to 200-600 Hz, so to account for boundary effects, a range of190-600 Hz is chosen for the initial TF plot. As a proof of concept forthe topographical detection of fast ripple oscillations, eighty-eight600-millisecond clips, which contain possible fast ripple events wereanalyzed. The clips came from a recording from a patient undergoingintracranial monitoring with depth electrodes, and determined usingindependent component analysis. Of these clips, fast ripples weredetected in 56. The fast ripple oscillations had an average frequency of260.8±42.8 Hz, a mean power magnitude of 3.86±6.51*

10

{circumflex over ( )}5, and a mean duration of 21.0±9.3 ms (FIG. 9).

Simultaneous Detection of Ripples and Fast Ripples with ReflexDetection:

Simultaneous detection of ripples and fast ripples with reflexdetection: During the topographical analysis of the ripple range TFplot, the device may detect open loop contours which begin and terminateat the upper frequency limit of the TF plot. This will trigger a fastripple reflex detection. A second TF plot is generated in the frequencyrange of 200-600 Hz, for the entire clip. If a ripple was originallydetected, the reflex detection will be focused on the period within 0.1seconds of the first event, whereas if no ripple event was originallydetected, the reflex detection will focus on the period within 0.1seconds of the peak power coordinate. As a proof of concept of reflexdetection we analyzed 9,206 600-millisecond clips containing thought toexhibit ripple oscillations, 118 of these clips triggered reflex fastripple detections, although no fast ripples were detected.

Classifying Ripples on Spikes and Lower-Frequency Oscillations DuringSleep:

We categorized the ripple on oscillations in to subtypes using a novelapproach. We first applied an optimized Hamming-windowed FIR band-passfilter (eegfiltnew.m; EEGLAB, https://sccn.ucsd.edu/eeglab) to all theiEEG recordings with the following low- and high-pass cutoff values:slow (0.1-2 Hz), delta (2-4 Hz), theta (4-10 Hz), and spindle band(12-16 Hz). We then calculated the instantaneous amplitude of theHilbert transformed band-pass filtered signals. The instantaneousamplitude was normalized. For each distinct frequency band, we useddifferent minimum amplitude and duration criteria to identify epochs inwhich oscillatory bursts appeared. The amplitude and duration thresholdsfor each oscillatory type were adjusted and optimized on the basis ofvisual inspection of computer annotated iEEG recordings. Afteridentifying the epochs of slow, delta, theta-band, and spindle-bandbursts, the time stamps were used to classify the ripple on oscillationin a non-mutually exclusive manner. To examine and quantify phaseamplitude coupling, we transformed each ripple event into a ripplephasor, as described in Eqn. 2.

$\begin{matrix}{{ve}^{i\; \theta} = {\sum\limits_{t}^{T}{{a(t)}{e^{i\; {\varphi {(t)}}}.}}}} & {{Eqn}.\mspace{14mu} 2}\end{matrix}$

-   -   where v is the vector strength of the phasor, theta its phase        angle, and a(t) and ø(t) are the respective instantaneous ripple        amplitude or the HFO event power magnitude across the boundary        counter and iEEG phase during the ripple across its duration [t        . . . T], ø(t) varied depending on whether the ripple was        categorized as a ripple on slow wave, delta, theta, or spindle.        For each band we calculated a unique instantaneous phase time        series ø(t) using a Hilbert transform. Therefore, each ripple        event superimposed on two or more, non-mutually exclusive        oscillatory activities (e.g., slow and spindle band) resulted in        a unique ripple phasor for each band.

Ripple Phasor Statistical Methods:

We developed a method to determine whether all the ripple phasors of agiven type recorded from a single macroelectrode contact exhibitedunimodal or bimodal clustering around preferred, i.e., mean phaseangle(s). We used the Circular Statistics Toolbox for Matlab(http://www.mathworks.com/matlabcentral/fileexchange/10676-circular-statistics-toolbox-directional-statistics)to test for statistically significant bimodal coupling by performing anagglomerative clustering of the angular data assuming two distributions(circ_clust.m). A criterion for bimodal coupling (i.e., two distinctclusters) was that both clusters had at least 15 members (i.e., angles).We introduced this criterion to increase the probability that theclusters defined by the agglomerative method reflected distinctpopulations as opposed to outliers. A threshold of 15 angles reflects aripple event in that distribution occurring approximately every fourminutes. We next tested whether the two clusters of phase angles weredistinct using the Kuiper's two-sample test (circ_kuipertest.m). If thistest met significance (p<0.05) the population of phase angles wascategorized as bimodal and the mean phase angles of each of the twoclusters was recorded. If the Kuiper two-sample test did not meetsignificance, or the agglomerative method resulted in clusters with lessthan 15 angles, we combined the clusters and tested for unimodalclustering around a mean phase angle using the Rayleigh test fornon-uniformity of circular data (circ_rtest.m). If this test metsignificance (p<0.05) the single mean phase angle defined using(circ_mean.m) was recorded, otherwise the distribution of angles wasassumed to be uniform. After calculating the mean phase angle(s) foreach electrode we asked if groups of electrodes confined within aneuroanatomical region had a mean phase angle distribution with one(i.e., unimodal) or two clusters (i.e., bimodal). We again usedagglomerative clustering and the Kuiper two-sample test (p<0.05) forthis purpose.

When the two clusters of mean phase angles were statistically distinct,each phase angle was labeled as the following based on their approximatediametrical alignment: the transition from the depth peak to trough(i.e., peak-trough transition) and the transition from the depth troughto peak (i.e., trough-peak transition). If the two clusters of meanphase angles were diametrically opposed between 0° and 180°, then thecluster with the mean phase angle distributed between 0° and 180° was byconvention defined as the ‘peak-trough transition’. If the twodistributions were diametrically opposed between 90° and 270°, then thecluster with the mean phase angle distributed between 90° and 270° wasdefined as the ‘peak-trough transition’. For a single macroelectrodecontact, we used the mean and standard deviation of the preferred phaseangle of the ‘peak-trough transition’ category derived from eachneuroanatomic region to distinguish the two clusters of phasors. If itspreferred phase angle was distributed within the mean and standarddeviation of the preferred phase angle, each ripple phasor wascategorized as a ripple event occurring during the peak-troughtransition. Otherwise, other ripple phasors were categorized as rippleevents occurring during the trough-peak transition. We then calculatedthe incidence ratio for both ripple phasor clusters that compare therelative rate in the SOZ compared to the NSOZ. The clusters weresubsequently used to separate the ripple phasors in to two distinctgroups corresponding to those that occurred during the depth peak-troughand trough-peak transitions

HFO-Soz Correlations.

We used receiver operating characteristic (ROC) curves (SupportingInformation), and a generalized estimated equation (GEE) approach(Supporting Information) to determine if different ripple types duringsleep occurred more frequently inside than outside the SOZ.

Differentiating Pathological and Physiological HFOs During Sleep.

Features of seizures can differ depending on sleep stages as well as thelocation of seizure onset. Temporal lobe seizures occur more frequentlyduring wakefulness, but frontal and parietal lobe seizures occur morefrequently during early non-rapid eye movement (NREM) sleep. Accurateintracranial monitoring is often required when surgery is considered forpatients with nocturnal seizures, especially those with the frontal lobeonset. At least three cardinal oscillatory events of NREM sleep maycontribute to the local and global neural changes that driveepileptogenesis: slow, spindle, and ripple oscillations. Slowoscillations (˜0.75 Hz) consisting of alternating phases of thehyperpolarized/down- and depolarized/up-state, involves cortical andthalamic networks. Spindle-band oscillations (12-16 Hz) are generated bysmaller local networks of thalamic and cortical neurons, and are oftenphase-locked to slow oscillations during slow-wave sleep. Ripples,defined as brief bursts (˜50-150 msec) of high-frequency (80-200 Hz)neurophysiological activity, are highly synchronized local networkevents that occur concurrently with slow waves, and sleep spindles. Inhumans with neocortical epilepsy, ripple rates can be increasedprimarily in the seizure-onset zone (SOZ), but sometimes also in thenon-SOZ (NSOZ). Ripple events occur during both the transition betweenthe down-up state, and the up-down state of slow waves. Thus, rippleamplitude can be considered coupled with slow wave phase at twopreferred phase angles. The ripples coupled to one preferred phase angle(i.e., down-up state) may be physiological, and the ripples coupled tothe other preferred phase angle (i.e., up-down state) may bepathological (FIG. 10). In accord with this notion, the ripple eventsthat occur during the up-down transition are generated more frequentlyin the SOZ. Also, intracranial EEG (iEEG) recordings from humanhippocampus contralateral to the SOZ have demonstrated that rippleevents that occur during the down-up transition are likely physiologicalbecause they are nested in the trough of spindle oscillations, and maymediate memory consolidation. In principle, a method that candistinguish putative pathological from physiological ripples should beable to distinguish two clusters of ripple events. One of these clustersshould exhibit elevated rates selectively in epileptogenic regions,relative to the other cluster. This technique was used to distinguishputative physiological and pathological ripples coupled with slow waves.It is not yet clear if this method can be applied to ripples that occursuperimposed on other sleep oscillations. To determine if couplingbetween ripple amplitude and the phase of delta, theta, and spindlesleep oscillations could help distinguish physiological ripple eventsfrom pathological ripple events, we 1) examined the relationship betweenthe phase of the distinct oscillations composing core sleep architectureand the amplitude of ripple events, 2) defined two distinct populationsof ripples based on the preferred phase angle of coupling, and 3) testedwhether one of the populations had a higher incidence ratio in the SOZ(FIG. 10).

Coupling Between Oscillatory Phase and Ripple Event Amplitude DuringSleep:

We selected depth electrode intracranial EEG (iEEG) recordings frompatients with focal-onset seizures. Nine patients had mesial temporallobe epilepsy (MTLE; 7 unilateral, 2 bilateral), seven patients hadmesial temporal and neocortical lobe epilepsy (MTLE+), and sevenpatients had neocortical epilepsy (NEO) (Supplementary Table 1). Amongthe 14 patients with neocortical SOZs, eight patients had SOZ siteslocated in the lateral temporal lobe, five patients had SOZ siteslocated in the frontal lobe, and six patients had SOZ sites located inthe parietal lobe. We analyzed iEEG recordings ranging from between 7-17depth electrodes with 7-16 macroelectrode contacts per patient. Wedetected a total of 207,175 inter-ictal ripples, which occurredsuperimposed on either epileptiform spikes or normal sleep architecture(FIG. 11). We utilized ripple phasors that relate the phase of eachlower-frequency oscillation to the amplitude of each ripple event (FIG.12A-B). As shown in FIG. 12C, polar plots of the population of deltaripple phasors identified in a single, neocortical depth electrodeduring the entire recording epoch often demonstrated two clusters ofripple phasor angles (i.e., a bimodal distribution). A bimodaldistribution of ripple phasor angles recorded from a singlemacroelectrode was not only observed in the case of delta ripplephasors, but also for slow, theta, and spindle ripple phasors. We nextasked whether the preferred phase angle(s) of ripple coupling wereconsistent across multiple recording sites confined to an anatomicalregion. When we pooled all the mean phase angles across all therecording sites confined within each anatomical region, we found thatthe distribution of these mean phase angles was also bimodal (i.e., twodistinct clusters, FIG. 12D; Kuiper's V-test, p<0.05). Overall, mostripple events occur during either the peak-trough or the trough-peaktransition of slow, delta, theta, and spindle band activity. In the fewcases that the mean preferred phase angles occurred around the trough ofan oscillation, these ripple events were labeled as the ‘peak-troughtransition’, whereas if the preferred phase angles occurred during thepeak of an oscillation, the events were labeled as the ‘trough-peaktransition’. Distinct couplings between sleep oscillatory phase andripple event amplitude in and outside the SOZ. We asked if the preferredphase angle of coupling between oscillatory phase and ripple eventamplitude during sleep differed in the SOZ as compared with the NSOZ. Inthe absence of an a priori assumption regarding the distribution ofripple phasor angles, we still observed differences between phase-eventamplitude coupling in the SOZ and NSOZ. In the parietal lobe, there wasa statistically significant difference in the distribution of ripplephasor angles detected in the SOZ as compared with the NSOZ for alloscillatory types coupled with ripple events. The distinction wasstrongest for ripples on delta (k=1.71E+06, p=0.001) (FIG. 13). We alsoobserved statistical differences for other ripple types in otherneuroanatomical locations. When it was assumed that ripple eventamplitude could be coupled with oscillatory phase around two preferredphase angles (i.e., two clusters), the relationship between thepreferred phase of ripple coupling and the location of the SOZ could bebetter quantified (FIG. 14). The incidence ratio of ripples occurringduring the peak-trough transition of slow oscillations was notsignificant in the parietal lobe (p=0.494), or did not reachsignificance in the frontal lobe after correction for multiplecomparisons (p=0.024). However, the incidence ratio of ripples occurringduring the trough-peak transition of slow oscillations was significantin both the parietal (p=0.001) and frontal lobe SOZ (p=0.004). Theeffect size was larger in the parietal lobe as compared with the frontallobe. We observed a similar distinction for ripples occurring during thepeak-trough and trough-peak transition of delta and theta band activityin the parietal lobe. In the frontal lobe, the incidence ratio ofripples occurring during the peak-trough (p=0.002) and trough-peaktransition (p=0.019) were both significant, but for theta (p=0.006) andspindle (p=0.009) ripples only the incidence ratio of ripples occurringduring the trough-peak transition was significant. In frontal andparietal lobe SOZ, the increased incidence ratio of ripples occurringduring the trough-peak transition of oscillations was observed from amajority of patients, and also in the resected region for twoneocortical epilepsy patients who were seizure free following surgery.Neither cluster of ripple phasors was increased in rates selectively forthe SOZ located within the lateral temporal lobe (all p>0.09), whereasboth clusters of ripple phasors were increased in rates in the mesialtemporal SOZ relative to NSOZ (all p<0.005). We also asked ifmacroelectrode contacts in SOZ sites more often exhibited a bimodaldistribution (i.e., two clusters) of preferred ripple phasor angles, ascompared with macroelectrode contacts in NSOZ sites. We found that inthe parietal lobe, and to a lesser extent the frontal lobe, a greaterproportion of recording sites in the SOZ exhibited a bimodal as opposedto a unimodal distribution (i.e., one cluster) of ripple phasor angles.

The report generated by the method includes the electrode locations oridentifiers and the HFOs that occurred at each of these locations.Specifically, the report includes the onset and offset times of the HFO,the HFO category, and the HFO properties such as frequency, duration,power, and the phase angle of the corresponding phasors. The report canbe used to generate annotations of the EEG record. The annotated EEG canbe visually interpreted by a clinician to guide clinical decisionmaking, and a therapeutic procedure such as; [1. resective or thermallyablative epilepsy surgery, 2. gene therapy, 3. cell therapy, 4. or theplacement of a device that stimulates the brain with electricity oroptogenetic stimulation] can be selected and targeted on the basis ofthe human visual inspection of the computer annotated EEG record. Thereport generated by the method can also include, for each and every HFOevent detected during a defined epoch, the HFO classification, HFOproperties, and the probability that an HFO is of pathological orphysiological origin on the basis of the HFO phasor analysis. Thisreport can be presented to the clinician or another software process, inthe absence of the original EEG record, to target a therapeuticprocedure such as resective or thermally ablative epilepsy surgery, genetherapy, cell therapy, or the placement of a device that stimulates thebrain with electricity or optogenetic stimulation.

The preferred embodiment is a device composed of a) a subject with aplurality of electrodes 10; b) a brain signal acquisition device(Amplifier/digitizer) 11 to record electrical signals from multiplelocations of a subject; c) a non-transitory computer-readable memorystoring instructions executable 12 by the computer processor 13; d) acomputer processor 13; e) digital outputs 14; f) a multichannelstimulator 15; and g) a subject 16 with a plurality of brain stimulatingelectrode(s). The computer processor; and a non-transitorycomputer-readable memory storing instructions executable by the computerprocessor; are configured to execute the method applied to the brainsignals recorded by the plurality of the electrodes, for example includethe RAM, BIOS, an operating system, application programs, program data,and other program modules as necessary to implement and run the system.The report generated by the method is translated by the computerprocessor and computer-readable memory in to a train of TTL pulsestransmitted by the digital output. A multichannel stimulator connectedto the digital output reads the TTL pulses and electrically stimulatesthe brain by generating current that is transmitted via the brainstimulating electrode.

The required features of the preferred embodiment are that the devicecan stimulate brain region(s) with therapeutic regimens to reduceseizures, and can also stimulate brain region(s) with therapeuticregimens to enhance memory. The selection of the regimen of brainstimulation used by the preferred embodiment is dependent on whether thepurpose of the stimulation is to reduce seizure occurrences and abortseizures, or alternatively enhance memory. The report generated by themethod identifies, classifies, and quantifies each HFO and determinesthe associated probability of each HFO resulting from a physiologicalprocess involved with memory and cognition, or a pathophysiologicalprocess involved with epilepsy based on the HFO type, HFO properties,and a comparison of the HFO phasor's phase angle with a probabilitydensity functions of phase angles derived from EEG and local fieldpotential recordings from healthy human brain areas, healthy primatebrain areas, and epileptogenic brain areas in patients with epilepsy.Thus, the report generated by the method can be utilized by thepreferred embodiment to determine when and where a brain area is engagedin memory related activity, or alternatively engaged inpathophysiological activity associated with epilepsy or epilepticseizures. The preferred embodiment can comprise a device that is worn orimplanted in the patient. Also, in another embodiment, the digitaloutput from the system can trigger an environmental stimulus such as anaudio or visual alert that warns the subject of an impending seizure.

What is claimed is:
 1. A method for identifying, categorizing, andquantifying electrical signals known as high-frequency oscillations(HFO) recorded from multiple locations of a subject using an electricalsensing device and using one or more processors to: Detecting electricalsignals from the electrical signaling device; applying a waveletconvolution to the electrical signals to generate a first time-frequencyrepresentation of the power of the signal; determining a region of thisfirst time-frequency plot that exceeds a threshold; wherein if thethreshold is not met no HFO is registered by the apparatus; determiningthe topography of a second time-frequency plot temporally centeredaround suprathreshold region of the first time-frequency plot byidentifying contours of isopower; determining at least two vertices ofeach contour as a coordinates of time and frequency; determining whichcontours exceed a specified threshold, and excluding all other contoursdetermining each contour as open-loop or closed-loop based on thecoordinates of the vertices; determining groups of contours based ontheir open- or closed-loop classification, power level, andtime-frequency coordinates; determining an event boundary contour as theclosed loop contour of lower isopower in the group that exceeds athreshold value; determining new event boundary coordinates bygenerating a third time-frequency plot with a lower minimum frequencylimit than the second time-frequency plot and recalculating the eventcontours and contour group, if the minimum frequency of the originalboundary contour is below a predetermined threshold; determining aduration of the HFO based on the event boundary contour; determining amean power of the HFO by calculating a mean power magnitude across allcoordinate points of the time-frequency plot within the event boundarycontour; determining an amplitude-weighted mean frequency of the HFOwithin the event boundary contour; determining if there are open loopcontours that begin and terminate at the upper frequency limit of thesecond time-frequency plot; determining if these open loop contours arerepresentative of a second HFO event by calculating a fourthtime-frequency plot in a higher frequency range, identifying the regionof greatest power that exceeds a threshold, defining contours ofisopower, determining if these are open or closed loop contours,defining groups of contours, and determining the even boundary contour;applying a distinct wavelet convolution to the electrical signals togenerate a time-frequency representation of the power of the signal in afrequency range less than the HFO to determine if the HFO issuperimposed on an inter-ictal discharge, or if an inter-ictal dischargehas a superimposed HFO by performing a wavelet convolution to theelectrical signals to generate a time-frequency representation of thepower of the signal (TF Plot); determining the gradient plot of this TFplot; by calculating both the horizontal gradient of the TF plot${\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}$and the vertical gradient of the TF plot${\nabla P_{f}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}$and combining these two gradients as ∇TF_(map)=√{square root over((∇P_(f))²+(∇P_(t))²)}; determining the borders of objects in the TFplot, and the gradient plot of the TF plot, discharges by binarizing theTF plot and its gradient using an appropriate threshold and applyingMoore-neighbor tracing algorithm; determining the volume of the objectsin the TF plot, and the gradient plot of the TF plot, using trapezoidalsurface integration within the object borders derived from the binarizedTF plot to the unbinarized TF plot, and gradient plot of the TF plot;determining if any of the objects are near the borders of the TF plot,or have a height-width ratio less than a threshold and excluding theseobject from further analysis; determining if an object is representativeof an inter-ictal discharge by defining the object of greatest volume inthe TF plot, and object of greatest volume in the gradient plot of theTF plot, and calculating if the volume of these objects exceedspre-defined thresholds; filtering the electrical signals recorded frommultiple locations of a subject using an electrical sensing device toproduce a low-frequency data stream to determine if the preferred phaseangle of coupling between the HFO and bursts of slower oscillations;transforming the low-frequency data stream to produce a low-frequencyinstantaneous phase; and instantaneous amplitude; determining the startand end times of an oscillatory burst by smoothing the instantaneousamplitude function and applying predetermined thresholds; determining ifthe HFO coincides with one or several oscillatory burst epochs;determining a HFO phasor with a mean phase angle and vector strengthvalue based on the low-frequency burst instantaneous phase and the meanHFO event power magnitude across the boundary counter; determining anHFO duration, an HFO mean power, an HFO mean frequency, and HFO phasorsfor all HFO events defined in the electrical signals from multiplelocations; identifying a location of the brain corresponding with thesame electrical signals determined to displays HFOs of a predefined HFOduration, HFO mean power, HFO mean frequency, and HFO phasors based onwhere the electrical signals were recorded; and generating a report ofthe identified location of the subject as a target for a therapeuticprocedure for treating a cause of the identified HFO.
 2. The method ofclaim 1, wherein the electrical sensing device is a non-invasive orminimally invasive electroencephalogram.
 3. The method of claim 1,wherein the electrical sensing device is an intracranialelectroencephalogram.
 4. The method of claim 1, wherein the locationcorresponds with epileptogenic brain.
 5. The method of claim 1, whereinthe location corresponds with brain wherein pathological activityinterferes with cognitive function and memory.
 6. The method of claim 1,wherein the location corresponds with brain actively encoding,consolidating, or recalling memory.
 7. The method of claim 1, furthercomprising performing a therapeutic procedure based on the identifiedreport of brain activity displaying HFOs of a predefined HFO duration,HFO mean power, HFO mean frequency, and HFO phasors.
 8. The method ofclaim 7, wherein the therapeutic procedure comprises one or moreprocedures selected from a group of procedures consisting of surgicalresection of a portion of the brain or a lesion thereon, laser ablationof a portion of the brain or a lesion thereon, targeted gene therapy ofa portion of the brain, cell therapy targeting a portion of the brain,and implanting a therapeutic device in the brain.
 9. The method of claim1, further comprising identifying, in the generated report, aneurological or psychiatric illness associated with the identifiedlocation.
 10. The method claim 1, wherein further comprising recordingelectrical signals using a plurality of recording electrodes situated atmultiple locations relative to the brain of the subject.
 11. A systemfor identifying brain electrical activity displaying high-frequencyoscillations, comprising: a data acquisition device for receiving anelectrical signal sensing device configured to record electrical signalsfrom multiple locations of the patient; a memory storage system forstoring instructions; and a microprocessor communicatively coupled tothe memory storage system, the microprocessor being configured toexecute instructions stored in the memory storage system to cause thesystem to: record, using the electrical signal sensing device,electrical signals from multiple locations in the brain of a subject;filter the electrical signals to produce a high frequency oscillation(HFO) data stream and a low-frequency data stream; apply independentcomponent analysis to the HFO data stream and removing noise from theHFO data stream; determine the location of HFO events in the HFO datastream; apply a wavelet convolution to the electrical signals at thelocation of HFO events to generate a time-frequency plot representationof the power of the signal; determine a region of the firsttime-frequency plot that exceeds a threshold; wherein if the thresholdis not met no HFO is registered by the apparatus; determine thetopography of a second time-frequency plot temporally centered aroundsuprathreshold region of the first time-frequency plot by identifyingcontours of isopower; determine at least two vertices of each contour asa coordinates of time and frequency; determine which contours exceed aspecified threshold, and excluding all other contours; determine eachcontour as open-loop or closed-loop based on the coordinates of thevertices; determine groups of contours based on their open- orclosed-loop classification, power level, and time-frequency coordinates;determine an event boundary contour as the closed loop contour of lowerisopower in the group that exceeds a threshold value; determine newevent boundary coordinates by generating a third time-frequency plotwith a lower minimum frequency limit than the second time-frequency plotand recalculating the event contours and contour group, if the minimumfrequency of the original boundary contour is below a predeterminedthreshold; determine a duration of the HFO event based on the eventboundary contour; determine a mean power of the HFO by calculating themean power magnitude across all coordinate points of the time-frequencyplot within the event boundary contour; determining anamplitude-weighted mean frequency of the HFO even within the boundarycontour; determine if there are open loop contours that begin andterminate at the upper frequency limit of the second time-frequencyplot; determine if these open loop contours are representative of asecond HFO event by calculating a fourth time-frequency plot in a higherfrequency range, identifying the region of greatest power that exceeds athreshold, defining contours of isopower, determining if these are openor closed loop contours, defining groups of contours, and determiningthe even boundary contour; applying a distinct wavelet convolution tothe electrical signals to generate a time-frequency representation ofthe power of the signal in a frequency range less than the HFO todetermine if the HFO event is superimposed on an inter-ictal discharge,or if an inter-ictal discharge has a superimposed HFO by performing awavelet convolution to the electrical signals to generate atime-frequency representation of the power of the signal (TF plot);determine the gradient plot of this TF plot; by calculating both thehorizontal gradient of the TF plot${\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}$and the vertical gradient of the TF plot${\nabla P_{f}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}$and combining these two gradients as ∇TF_(map)=√{square root over((∇P_(f))²+(∇P_(t))²)}; determine the borders of objects in the TF plot,and the gradient plot of the TF plot, discharges by binarizing the TFplot and its gradient using an appropriate threshold and applyingMoore-neighbor tracing algorithm; determine the volume of the objects inthe TF plot, and the gradient plot of the TF plot, using trapezoidalsurface integration within the object borders derived from the binarizedTF plot to the unbinarized TF plot, and gradient plot of the TF plot;determine if any of the objects are near the borders of the TF plot, orhave a height-width ratio less than a threshold and excluding theseobject from further analysis; determine if an object is representativeof an inter-ictal discharge by defining the object of greatest volume inthe TF plot, and object of greatest volume in the gradient plot of theTF plot, and calculate if the volume of these objects exceedspre-defined thresholds; filter the electrical signals recorded frommultiple locations of a subject using an electrical sensing device toproduce a low-frequency data stream to determine if the preferred phaseangle of coupling between the HFO and bursts of slower oscillations;transform the low-frequency data stream to produce a low-frequencyinstantaneous phase; and instantaneous amplitude; determine the startand end times of oscillatory bursts by smoothing the instantaneousamplitude function and applying predetermined thresholds; determine ifthe HFO coincides with one or several oscillatory burst epochs;determine a HFO phasor with a mean phase angle and vector strength valuebased on the low-frequency burst instantaneous phase and the mean HFOevent power magnitude across the boundary counter; determine theprobability that a HFO resulted from either a process involved withmemory and cognition, or a pathophysiological process involved withepilepsy on the basis of a comparison of the HFO duration, HFO meanpower, HFO mean frequency, and HFO phasor with a pre-existing databaseof the values of these parameters; identify a location of the braincorresponding with the same electrical signals determined to displaysHFOs of a predefined HFO duration, HFO mean power, HFO mean frequency,HFO phasors, and pathological HFO probability, based on where theelectrical signals were recorded; and generate a report of theidentified location of the subject as a target for a therapeuticprocedure for treating a cause of the identified HFO events.
 12. Thesystem of claim 11, wherein the electrical signal sending devicecomprises an implantable or wearable device.
 13. The system of claim 11,further comprising implanting a therapeutic device in the subject, andusing the therapeutic device to administer, without user intervention,the therapy in response to the report of electrical signals atidentified locations displaying HFOs of a predefined HFO duration, HFOmean power, HFO mean frequency, HFO phasor, and pathological HFOprobability.
 14. The system of claim 14, wherein the therapy isadministered based on when the electrical signals with HFOs of apredefined HFO duration, HFO mean power, HFO mean frequency, HFO phasor,and HFO pathological probability were recorded.
 15. The system of claim14, wherein the microprocessor is further configured to executeinstructions stored in memory storage system to cause the system to usethe therapeutic device to administer, without user intervention, atherapy targeted at the identified location.
 16. The system of claim 14,wherein the therapy is electrical stimulation.
 17. The system of claim14, wherein the therapy is optogenetic stimulation.
 18. The system ofclaim 12, wherein the therapeutic device administers, without userintervention, an environmental stimulation, such as an audio alert, inresponse to the report of electrical signals at identified locationsdisplaying HFOs of a predefined HFO duration, HFO mean power, HFO meanfrequency, HFO phasor, and pathological HFO probability.
 19. The systemof claim 19, wherein the environmental stimulation is administered basedon when the electrical signals with HFOs of a predefined HFO duration,HFO mean power, HFO mean frequency, HFO phasor, and HFO pathologicalprobability were recorded.
 20. A non-transitory computer readable mediumstoring instructions that, when executed by a processor, are configuredto identify brain electrical activity displaying of a predefined HFOduration, HFO mean power, HFO mean frequency, and HFO phasor wererecorded by: receiving electrical signals recorded from multiplelocations in the brain of a subject using an electrical signal sensingdevice; filtering the electrical signals to produce a high frequencyoscillation (HFO) data stream and a low-frequency data stream; applyingindependent component analysis to the HFO data stream and removing noisefrom the HFO data stream; determining the location of HFO events in theHFO data stream; applying a wavelet convolution to the electricalsignals at the location of HFO events to generate a time-frequencyrepresentation of the power of the signal; determining a region of thisfirst time-frequency plot that exceeds a threshold; wherein if thethreshold is not met no HFO is registered by the apparatus; determiningthe topography of a second time-frequency plot temporally centeredaround suprathreshold region of the first time-frequency plot byidentifying contours of isopower; determining at least two vertices ofeach contour as a coordinates of time and frequency; determining whichcontours exceed a specified threshold, and excluding all other contours;determining each contour as open-loop or closed-loop based on thecoordinates of the vertices; determining groups of contours based ontheir open- or closed-loop classification, power level, andtime-frequency coordinates; determining an event boundary contour as theclosed loop contour of lower isopower in the group that exceeds athreshold value; determining new event boundary coordinates bygenerating a third time-frequency plot with a lower minimum frequencylimit than the second time-frequency plot and recalculating the eventcontours and contour group, if the minimum frequency of the originalboundary contour is below a predetermined threshold; determining aduration of the HFO event based on the event boundary contour;determining a mean power of the HFO by calculating the mean powermagnitude across all coordinate points of the time-frequency plot withinthe event boundary contour; determining an amplitude-weighted meanfrequency of the HFO even within the boundary contour; determining ifthere are open loop contours that begin and terminate at the upperfrequency limit of the second time-frequency plot; determining if theseopen loop contours are representative of a second HFO event bycalculating a fourth time-frequency plot in a higher frequency range,identifying the region of greatest power that exceeds a threshold,defining contours of isopower, determining if these are open or closedloop contours, defining groups of contours, and determining the evenboundary contour; applying a distinct wavelet convolution to theelectrical signals to generate a time-frequency representation of thepower of the signal in a frequency range less than the HFO to determineif the HFO event is superimposed on an inter-ictal discharge, or if aninter-ictal discharge has a superimposed HFO by performing a waveletconvolution to the electrical signals to generate a time-frequencyrepresentation of the power of the signal (TF plot); determining thegradient plot of this TF plot; by calculating both the horizontalgradient of the TF plot,${{\nabla P_{t}} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({time})}};$and the vertical gradient of the TF plot,${P_{f} = \frac{\partial\left( {{power}\mspace{14mu} {magnitude}} \right)}{\partial({frequency})}};$and combining these two gradients as,∇TF _(map)=√{square root over ((∇P _(f))²+(∇P _(t))²)}; determining theborders of objects in the TF plot, and the gradient plot of the TF plot,discharges by binarizing the TF plot and its gradient using anappropriate threshold and applying Moore-neighbor tracing algorithm;determining the volume of the objects in the TF plot, and the gradientplot of the TF plot, using trapezoidal surface integration within theobject borders derived from the binarized TF plot to the unbinarized TFplot, and gradient plot of the TF plot; determining if any of theobjects are near the borders of the TF plot, or have a height-widthratio less than a threshold and excluding these object from furtheranalysis; determining if an object is representative of an inter-ictaldischarge by defining the object of greatest volume in the TF plot, andobject of greatest volume in the gradient plot of the TF plot, andcalculating if the volume of these objects exceeds pre-definedthresholds; filter the electrical signals recorded from multiplelocations of a subject using an electrical sensing device to produce alow-frequency data stream to determine if the preferred phase angle ofcoupling between the HFO and bursts of slower oscillations; transformthe low-frequency data stream to produce a low-frequency instantaneousphase; and instantaneous amplitude; determining the start and end timesof oscillatory bursts by smoothing the instantaneous amplitude functionand applying predetermined thresholds; determining if the HFO coincideswith one or several oscillatory burst epochs; determining a HFO phasorwith a mean phase angle and vector strength value based on thelow-frequency burst instantaneous phase and the mean HFO event powermagnitude across the boundary counter; determining the probability thata HFO resulted from either a process involved with memory and cognition,or a pathophysiological process involved with epilepsy on the basis of acomparison of the HFO duration, HFO mean power, HFO mean frequency, andHFO phasor with a pre-existing database of the values of theseparameters; identifying a location of the brain corresponding with thesame electrical signals determined to displays HFOs of a predefined HFOduration, HFO mean power, HFO mean frequency, HFO phasors, andpathological HFO probability, based on where the electrical signals wererecorded; and generating a report of the identified location of thesubject as a target for a therapeutic procedure for treating a cause ofthe identified HFO events.